import Vue from 'vue'
import VueRouter from 'vue-router'


// import routers from './routers'

Vue.use(VueRouter)

let router = new VueRouter({
  // routers
    routes:[
        {
            name:'home',
            path: '/home',
            // 路由懒加载
            component: ()=> import('@/pages/Home'),
            meta:{ show:true,}

          },
          {
            path: '/login',
            component: () => import('@/pages/Login'),
            // meta:{ show:false,}
          },
          {
            path: '/bindCourse',
            name: 'bindCourse',
            component: ()=>import('@/pages/BindCourse'),
          },
          {
            path: '/loginType2',
            name: 'loginType2',
            component: ()=>import('@/pages/LoginType2'),
          },
          {
            path: '/mine',
            name:'mine',
            meta:{ show:true,},
            component:()=>import('@/pages/Mine')
          },
          {
            path: '/order',
            name:'order',
            component:()=>import('@/pages/Order'),
            children:[
              {
              path: 'orderList',
              name:'orderList',
              component:()=>import('@/pages/Order/OrderList'),
            },{
              path:'/order',
              redirect:'/order/orderList'
            }
          ]
          },
          {
            path: '/payDetail',
            name: 'payDetail',
            component:()=>import('@/pages/PayDetail'),
            children: [
              {
                path: 'planPay',
                name: 'planPay',
                component:()=>import('@/pages/PayDetail/PlanPay'),
              },
              {
                path: 'adancePay',
                name: 'adancePay',
                component:()=>import('@/pages/PayDetail/AdancePay'),
              },
              {
                path: 'recordPay',
                name: 'recordPay',
                component:()=>import('@/pages/PayDetail/RecordPay'),
              },
              {
                path: 'InstallmentDetail',
                name: 'InstallmentDetail',
                component:()=>import('@/pages/PayDetail/InstallmentDetail'),
              },
              {
                path:'/payDetail',
                redirect:'/payDetail/planPay'
              },
            ]
          },
          {
            name:'Certification',
            path:'/Certification',
            component:()=>import('@/pages/Certification'),
          },
          {
            path: '/successCertifi',
            name: 'successCertifi',
            component:()=>import('@/pages/successCertifi'),
          },
          // 重定向到home
          {
            path: '*',
            redirect: '/home',
          },
    ]

})

export default router

